package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.PurOrderApprovalMapper;
import com.ruoyi.system.domain.PurOrderApproval;
import com.ruoyi.system.service.IPurOrderApprovalService;
import com.ruoyi.common.core.text.Convert;

/**
 * 采购订单审核Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-16
 */
@Service
public class PurOrderApprovalServiceImpl implements IPurOrderApprovalService 
{
    @Autowired
    private PurOrderApprovalMapper purOrderApprovalMapper;

    /**
     * 查询采购订单审核
     * 
     * @param approvalId 采购订单审核主键
     * @return 采购订单审核
     */
    @Override
    public PurOrderApproval selectPurOrderApprovalByApprovalId(Long approvalId)
    {
        return purOrderApprovalMapper.selectPurOrderApprovalByApprovalId(approvalId);
    }

    /**
     * 查询采购订单审核列表
     * 
     * @param purOrderApproval 采购订单审核
     * @return 采购订单审核
     */
    @Override
    public List<PurOrderApproval> selectPurOrderApprovalList(PurOrderApproval purOrderApproval)
    {
        return purOrderApprovalMapper.selectPurOrderApprovalList(purOrderApproval);
    }

    /**
     * 新增采购订单审核
     * 
     * @param purOrderApproval 采购订单审核
     * @return 结果
     */
    @Override
    public int insertPurOrderApproval(PurOrderApproval purOrderApproval)
    {
        return purOrderApprovalMapper.insertPurOrderApproval(purOrderApproval);
    }

    /**
     * 修改采购订单审核
     * 
     * @param purOrderApproval 采购订单审核
     * @return 结果
     */
    @Override
    public int updatePurOrderApproval(PurOrderApproval purOrderApproval)
    {
        return purOrderApprovalMapper.updatePurOrderApproval(purOrderApproval);
    }

    /**
     * 批量删除采购订单审核
     * 
     * @param approvalIds 需要删除的采购订单审核主键
     * @return 结果
     */
    @Override
    public int deletePurOrderApprovalByApprovalIds(String approvalIds)
    {
        return purOrderApprovalMapper.deletePurOrderApprovalByApprovalIds(Convert.toStrArray(approvalIds));
    }

    /**
     * 删除采购订单审核信息
     * 
     * @param approvalId 采购订单审核主键
     * @return 结果
     */
    @Override
    public int deletePurOrderApprovalByApprovalId(Long approvalId)
    {
        return purOrderApprovalMapper.deletePurOrderApprovalByApprovalId(approvalId);
    }
}
